package com.itheima.reggie.service;

import com.itheima.reggie.common.R;
import com.itheima.reggie.entity.ShoppingCart;

import java.util.List;

public interface ShoppingCartService {

    /**
     * 添加购物车
     * @param shoppingCart
     * @return
     */
    R<ShoppingCart> addShoppingCart(ShoppingCart shoppingCart);

    /**
     * 购物车减数量
     * @param shoppingCart

     */
    R<ShoppingCart> subShoppingCart(ShoppingCart shoppingCart);

    /**
     * 查询购物车列表
     * @param id
     * @return
     */
    R<List<ShoppingCart>> findShoppingCartByUserId(Long id);

    /**
     * 清空购物车
     * @return
     */
    int cleanShoppingCart(Long userId);
}
